import {get_list} from "@/utils/index"
const moduleName={
 namespaced: true,
 state:{
    data:[],
    childrenData:[],
    ind:0
 },
 mutations: {
    setdata(state, payload) {
        state.data =payload
        state.childrenData=payload[0].children
    },
    setchildren(state,ind){
      
        state.ind=ind
        state.childrenData=  state.data[ind].children
    }
 },
 actions: {
   async getlist({commit}){
    let {data}=await get_list()
    console.log(data);
    commit("setdata",data)
   }
 },
}
export default moduleName